package com.example.controller;

import com.example.common.response.ServerResponse;
import com.example.dto.DemoDTO;
import com.example.dto.NovelDTO;
import com.example.service.DemoService;
import com.example.service.NovelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 小说下载请求控制器
 * @Auther: Swain
 * @Date: 2021/1/18 16:18
 * @Version 1.0.0
 */
@Api(tags = "小说下载请求控制器")
@Validated
@RestController
@RequestMapping(value = "/novel")
public class NovelController {


    @Autowired
    private NovelService novelService;

    @PostMapping("/add/single")
    @ApiOperation(value = "新增单个", notes = "新增单个")
    public ServerResponse addSingle(@RequestBody @Validated(NovelDTO.add.class) NovelDTO novelDTO) {
        return novelService.addSingle(novelDTO);
    }


}
